package com.education.wisdom.service.impl;


import com.education.common.utils.Convert;
import com.education.wisdom.mapper.AnchorinformationMapper;
import com.education.wisdom.pojo.Anchorinformation;
import com.education.wisdom.service.IAnchorinformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 主播 服务层实现
 * 
 * @author ruoyi
 * @date 2019-02-18
 */
@Service
public class AnchorinformationServiceImpl implements IAnchorinformationService
{
	@Autowired
	private AnchorinformationMapper anchorinformationMapper;

	/**
     * 查询主播信息
     * 
     * @param id 主播ID
     * @return 主播信息
     */
    @Override
	public Anchorinformation selectAnchorinformationById(String userId)
	{
	    return anchorinformationMapper.selectAnchorinformationById(userId);
	}
	
	/**
     * 查询主播列表
     * 
     * @param anchorinformation 主播信息
     * @return 主播集合
     */
	@Override
	public List<Anchorinformation> selectAnchorinformationList(Anchorinformation anchorinformation)
	{
	    return anchorinformationMapper.selectAnchorinformationList(anchorinformation);
	}
	
    /**
     * 新增主播
     * 
     * @param anchorinformation 主播信息
     * @return 结果
     */
	@Override
	public int insertAnchorinformation(Anchorinformation anchorinformation)
	{
	    return anchorinformationMapper.insertAnchorinformation(anchorinformation);
	}
	
	/**
     * 修改主播
     * 
     * @param anchorinformation 主播信息
     * @return 结果
     */
	@Override
	public int updateAnchorinformation(Anchorinformation anchorinformation)
	{
	    return anchorinformationMapper.updateAnchorinformation(anchorinformation);
	}

	/**
     * 删除主播对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteAnchorinformationByIds(String ids)
	{
		return anchorinformationMapper.deleteAnchorinformationByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<Anchorinformation> selectShowLive(Map<String, Object> map) {
		return anchorinformationMapper.selectShowLive(map);
	}

	@Override
	public Anchorinformation selectIsTake(Map<String, Object> map) {
		return anchorinformationMapper.selectIsTake(map);
	}

	@Override
	public List<Anchorinformation> selectShowLiveByType(Map<String, Object> map) {
		return anchorinformationMapper.selectShowLiveByType(map);
	}
	
}
